package com.kk.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author o_o
 */
@Slf4j
@RestController
public class OrderController {

    private final String URL = "http://consul-provider-payment";

    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/order/getport")
    public String paymentConsul() {
        System.out.println(restTemplate);
        return restTemplate.getForObject(URL + "/getport", String.class);
    }
}
